Skip to content

ImportBuddy Log Cleaning improvements#30

Merged
lfoust merged 7 commits into
TheDiscDb:mainfrom
ociaw:clean-log-improvements
Nov 14, 2024
Merged

ImportBuddy Log Cleaning improvements#30
lfoust merged 7 commits into
TheDiscDb:mainfrom
ociaw:clean-log-improvements

Conversation

@ociaw
Copy link
Copy Markdown
Contributor

@ociaw ociaw commented Nov 11, 2024

Instead of stripping all MSG and DRV log entries, ImportBuddy now redacts log entries as described in #27. Right now, any known potentially sensitive information is replaced by "redacted by ImportBuddy". Let me know if the message should change, or if the redaction needs to be more/less aggressive.

This necessitated a change in MSG log parsing, as lines including a , character in the message template or any message argument broke the parser since it was a simple string.Split(','). To fix this, I wrote/added CsvEnumerator, which is capable of parsing the comma-separated values while also taking into account quoted strings and escaped characters.

Additionally, the casing of the Linux appsettings file path was corrected.

…information from them

The debug file path, drive name, and .MakeMKV path are redacted from MSG 1004, 2003, and 3338. Additionally, the drive name and letter are redacted from DRV log entries, and the disc name is redacted from all unused drives.
Linux filesystems are typically case-sensitive, so having consistent case is necessary on most systems.
Since previously MessageLogLine.Parse was doing a naïve string.Split on a comma, log entries that contained a comma in the template string or in an argument got broken down incorrectly. Borrowed from a similar project, CsvEnumerator correctly keeps quoted strings together, only splitting outside of such a string. This may also be helpful in other log parsers in ImportBuddy.
Copy link
Copy Markdown
Collaborator

@lfoust lfoust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this. A very thorough job. Just a couple of small comments

Comment thread tools/ImportBuddy/source/ImportBuddy/TheDiscDb.MakeMkv/MakeMkvHelper.cs Outdated
Comment thread tools/ImportBuddy/source/ImportBuddy/TheDiscDb.MakeMkv/MakeMkvHelper.cs Outdated
Comment thread tools/ImportBuddy/source/ImportBuddy/ImportBuddy/Program.cs
@ociaw ociaw requested a review from lfoust November 13, 2024 05:48
@lfoust lfoust merged commit 5400ce8 into TheDiscDb:main Nov 14, 2024
@ociaw ociaw deleted the clean-log-improvements branch November 14, 2024 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants